<include file="Common:__head__"/>
<div class="permissions-tabs">
    <a class="role tabs-bg" href="{:U('system/sms_template')}">SMS信息模板</a>
    <a class="keeper" href="{:U('Order/msg_conf')}">模板信息</a>
</div>
<div class="permissions-content">
    <div class="permissions-le">
        <div class="message-set">
            <span class="hints">操作提示</span>
            <span class="hints-dec">为短信服务正常使用，请确认短信模板与您短信服务的模板一致</span>
        </div>
        <div class="add-msg">
            <a class="add-role" href="{:U('System/add_sms_template')}">添加模板</a>
        </div>
        <div class="permissions-table">
            <table border="0" width="100%" class="msg-table">
                <thead>
                <tr>
                    <td width="10%">短信服务</td>
                    <td width="10%">模板名称</td>
                    <td width="50%">模板内容</td>
                    <td width="10%">签名</td>
                    <td width="10%">应用场景</td>
                    <td width="10%">操作</td>
                </tr>
                </thead>
                <tbody class="msg-set">
                <foreach name="sms_templates" item="sms">
                <tr>
                    <td>
                        <div style="text-align: center;">{$sms['sms_sv']}</div>
                    </td>
                    <td>
                        <div style="text-align: center;">{$sms['sms_title']}</div>
                    </td>
                    <td>
                        <div style="text-align: center;">{$sms['tpl_content']}</div>
                    </td>
                    <td>
                        <div style="text-align: center;">{$sms['sms_sign']}</div>
                    </td>
                    <td>
                        <div style="text-align: center;">{$tpl_scene[$sms['send_scene']]}</div>
                    </td>
                    <td>
                        <div style="text-align: center;">
                            <a class="btn btn-red" onclick="delRegion('{$sms.tpl_id}')">删除</a>
                        </div>
                    </td>
                </tr>
                </foreach>
                </tbody>
            </table>
        </div>
    </div>
    <div class="permissions-ri">
        <a href="" class="permissions-help">帮助和服务</a>
    </div>
</div>
<script>
    function delRegion( id){
        layer.confirm('确定删除此模板？', {icon: 3, title:'删除提示'}, function(){
            $.ajax({
                url: "{:U('System/del_sms_template')}",
                type: "post",
                data: {tpl_id : id},
                success: function (data)
                {
                    if(data.status == "success"){
                        location.reload(true);
                    }else{
                        layer.alert(data.msg);
                    }
                }
            });
        });
    }
</script>
<include file="common:__foot__"/>
